package com.gitee.hermer.engine.jars.app.sdk.utils;

import java.util.List;

import com.gitee.hermer.boot.jee.commons.bean.utils.BeanLocator;
import com.gitee.hermer.engine.jars.core.xauth.IXAuthService;
import com.gitee.hermer.engine.jars.core.xauth.domain.DynamicMenu;
import com.jc.support.auth.web.authc.Account;
import com.jc.support.user.bo.DynamicMenuBO;

public class SecurityUtils {

	private static IXAuthService authService;

	static{
		try {
			authService = BeanLocator.getBean(IXAuthService.class); 
		} catch (Exception e) { }
	}

	public static List<DynamicMenu> getEngineMenus(){
		return authService.getEngineMenus();
	}

	public static Account getCurrentAccount(){
		return authService.getCurrentAccount();
	}

	public static void setCurrentSessionAttribute(String key,String value){
		authService.setCurrentSessionAttribute(key, value);
	}


	public static <T> T getCurrentSessionAttribute(String key){
		return authService.getCurrentSessionAttribute(key);
	}

	public static String getId(){
		return authService.getId();
	}

	public List<DynamicMenu> generateMenuTree(List<DynamicMenuBO> list){
		return authService.generateMenuTree(list);
	}


}
